<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="include/header_css::header('上级部门-部门管理')"></head>
<body>
	<div id="dpLTE" class="container-fluid">
		<ul id="departTree" class="ztree"></ul>
	</div>
	<div th:include="include/footer_js::footer"></div>
	<script type="text/javascript">
		var setting = {
			data : {
				simpleData : {
					enable : true,
					idKey : "depart_code",
					pIdKey : "parent_code",
					rootPId : -1
				},
				key : {
					url : "nourl"
				}
			}
		};
		var ztree;

		var vm = new Vue(
				{
					el : 'ltLTE',
					methods : {
						getDepartment : function() {
							$.get('../../sys/depart/select',
									function(r) {
										ztree = $.fn.zTree.init(
												$("#departTree"),
												setting, r.rows);
										ztree
										var node = ztree
												.getNodeByParam(
														"depart_code",
														top.layerForm.vm.department.parent_code);
										ztree.expandAll(true);
										ztree.selectNode(node);
										/* 	top.layerForm.vm.department.parentName=node.name; */
									});
						},
						acceptClick : function() {
							var node = ztree.getSelectedNodes();
							top.layerForm.vm.department.parent_code = node[0].depart_code;
							top.layerForm.vm.department.parentName = node[0].name;
							dialogClose();
						}
					},
					created : function() {
						this.getDepartment();
					}
				});
	</script>
</body>
</html>